create database in php

33

 /*MYSQL database can be created easily using this simple script.
The CREATE DATABASE statement creates the database.*/

<?php
   $con=mysqli_connect("example.com","username","password");
   $sql="CREATE DATABASE my_db";
   if (mysqli_query($con,$sql)) {
      echo "Database my_db created successfully";
   }
?>

Comments

Submit
0 Comments